/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Classes;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Jaroslav
 */
@Embeddable
public class BugProjectPK implements Serializable {
    @Column(name = "bug_id", nullable = false)
    private int bugId;
    @Column(name = "project_id", nullable = false)
    private int projectId;

    public BugProjectPK() {
    }

    public BugProjectPK(int bugId, int projectId) {
        this.bugId = bugId;
        this.projectId = projectId;
    }

    public int getBugId() {
        return bugId;
    }

    public void setBugId(int bugId) {
        this.bugId = bugId;
    }

    public int getProjectId() {
        return projectId;
    }

    public void setProjectId(int projectId) {
        this.projectId = projectId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) bugId;
        hash += (int) projectId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BugProjectPK)) {
            return false;
        }
        BugProjectPK other = (BugProjectPK) object;
        if (this.bugId != other.bugId) {
            return false;
        }
        if (this.projectId != other.projectId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Classes.BugProjectPK[bugId=" + bugId + ", projectId=" + projectId + "]";
    }

}
